package com.itheima.servlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

//Servlet的生命周期
public class ServletDem03 extends HttpServlet {
    //对象出生的过程

    @Override
    public void init() throws ServletException {
        System.out.println("对象创建并初始化成功。。");
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("接收到了客户的请求。。。");
    }
    //对象服务的过程
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doGet(req,resp);
    }
    //对象死亡的过程
    @Override
    public void destroy() {
        System.out.println("对象销毁了。。。");
    }
}
